import { Navigate, type RouteObject } from 'react-router-dom'
import App from '@/App'
import Test from '@/pages/test'
import TestB from '@/pages/test2'
import Home from '@/pages/home'
import Perception from '@/pages/perception'
import Resources from '@/pages/resources'


export interface MyRouterHandle {
  auth?: boolean, //是否能点击
  breadcrumb?: string
}

export interface MyRouteObject extends Omit<RouteObject, 'handle' | 'children'> {
  handle?: MyRouterHandle,
  children?: MyRouteObject[]
}

const routers: MyRouteObject[] = ([
  {
    path: '/',
    element: <App />,
    children: [
      {
        index: true, // 默认子路由
        element: <Navigate to="lbs-home" replace />
      },
      {
        path: 'lbs-home',
        element: <Home />,
      },
      {
        path: 'lbs-perception',
        element: <Perception />,
      },
      {
        path: 'lbs-resources',
        element: <Resources />,
      },
      {
        path: 'test1',
        element: <Test />,
      },
      {
        path: 'test2',
        element: <TestB />,
      }
    ]
  },
])




export default routers as RouteObject[]